import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [{
    path: "/Home",
    component: () => import( /* webpackChunkName: "about" */ "../views/Home.vue"),
    children: [{
      path: "/Welcome",
      component: () => import( /* webpackChunkName: "about" */ "../components/Welcom.vue"),
    },
    {
      path: "/member",
      component: () => import( /* webpackChunkName: "about" */ "../components/member.vue"),
      meta: {
        bread: ['会员管理']
      }
    },
    {
      path: "/users",
      component: () => import( /* webpackChunkName: "about" */ "../components/User.vue"),
      meta: {
        bread: ['员工管理']
      }
    },
    {
      path: "/supplier",
      component: () => import( /* webpackChunkName: "about" */ "../components/supplier.vue"),
      meta: {
        bread: ['供应商管理']
      }
    },
    {
      path: "/goods",
      component: () => import( /* webpackChunkName: "about" */ "../components/goods.vue"),
      meta: {
        bread: ['商品管理']
      }
    },
  ]
  },
  //路由重定向
  {
    path: "/",
    redirect: "/Welcome",

  },
  {
    path: "/Login",
    component: () => import( /* webpackChunkName: "about" */ "../views/Login.vue"),
  },
];

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes,
});

export default router;